<?php

namespace App\Models\Application;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class ColumnAsset
 * @package App\Models\Application
 * @version July 19, 2018, 2:22 pm CST
 *
 * @property \App\Models\Application\Muticolumn muticolumn
 * @property integer muticolumn_id
 * @property integer asset_type
 * @property integer asset_id
 */
class ColumnAsset extends Model
{
    use SoftDeletes;


    public $table = 'column_assets';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'muticolumn_id',
        'asset_type',
        'asset_id'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'muticolumn_id' => 'integer',
        'asset_type' => 'integer',
        'asset_id' => 'integer'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        'asset_type' => 'required'
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function muticolumn()
    {
        return $this->hasOne(\App\Models\Application\Muticolumn::class, 'id', 'muticolumn_id');
    }


}
